// 创建一个字面量类型
let MyName: 'nick'
MyName = 'nick'

// 创建一个性别类型
let gender: '男' | '女'
gender = '男'
gender = '女'
// gender = '保密' Error

// 联合类型
let numOrStr: number | string
numOrStr = 13
numOrStr = 'six'
// numOrStr = false Error

function Other(other: number | string){
  return
}
console.log(Other(100))
console.log(Other('str'))